package top.mybatisx.sql.core.table;

import top.mybatisx.sql.core.sql.base.JoinEnum;
import top.mybatisx.sql.core.sql.base.OrderEnum;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 所有生成表的基类
 */
public class TableDef implements Serializable {

    public static final OrderEnum DESC_ = OrderEnum.DESC;
    public static final OrderEnum ASC_ = OrderEnum.ASC;

    // 所属数据库
    private String schema;
    // 表名
    private String tableName;
    // 别名
    private String alias;

    // 表连接方式 + 连接添加
    private JoinEnum joinEnum;
    private List<CondColumn> joinConditionList = new ArrayList<>();

    public TableDef(String tableName) {
        this.tableName = tableName;
    }

    // --------------------------- get / set ---------------------------------
    public TableDef() {

    }

    public String getSchema() {
        return schema;
    }

    public void setSchema(String schema) {
        this.schema = schema;
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public String getAlias() {
        return alias;
    }

    public void setAlias(String alias) {
        this.alias = alias;
    }

    public JoinEnum getJoinEnum() {
        return joinEnum;
    }

    public void setJoinEnum(JoinEnum joinEnum) {
        this.joinEnum = joinEnum;
    }

    public List<CondColumn> getJoinConditionList() {
        return joinConditionList;
    }

    public void setJoinConditionList(List<CondColumn> joinConditionList) {
        this.joinConditionList = joinConditionList;
    }
}
